package com.cfec.educationplatform.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 练习详情表
 * @TableName tb_pra_result
 */
@TableName(value ="tb_pra_result")
@Data
public class TbPraResult {
    /**
     * 
     */
    @TableId
    private Long resultId;

    /**
     * 题目信息
     */
    private String resTopicInfo;

    /**
     * 题目类型：0：选择题；1：填空题；2：计算题；3：简答题
     */
    private String resTopicClassify;

    /**
     * 用户答案
     */
    private String resUserAnswer;

    /**
     * 该题正确答案
     */
    private String resRightAnswer;

    /**
     * 结果：1：正确；0：错误
     */
    private String resultTopic;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 信息状态：0：弃用，1：使用
     */
    private String resultState;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbPraResult other = (TbPraResult) that;
        return (this.getResultId() == null ? other.getResultId() == null : this.getResultId().equals(other.getResultId()))
            && (this.getResTopicInfo() == null ? other.getResTopicInfo() == null : this.getResTopicInfo().equals(other.getResTopicInfo()))
            && (this.getResTopicClassify() == null ? other.getResTopicClassify() == null : this.getResTopicClassify().equals(other.getResTopicClassify()))
            && (this.getResUserAnswer() == null ? other.getResUserAnswer() == null : this.getResUserAnswer().equals(other.getResUserAnswer()))
            && (this.getResRightAnswer() == null ? other.getResRightAnswer() == null : this.getResRightAnswer().equals(other.getResRightAnswer()))
            && (this.getResultTopic() == null ? other.getResultTopic() == null : this.getResultTopic().equals(other.getResultTopic()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getResultState() == null ? other.getResultState() == null : this.getResultState().equals(other.getResultState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getResultId() == null) ? 0 : getResultId().hashCode());
        result = prime * result + ((getResTopicInfo() == null) ? 0 : getResTopicInfo().hashCode());
        result = prime * result + ((getResTopicClassify() == null) ? 0 : getResTopicClassify().hashCode());
        result = prime * result + ((getResUserAnswer() == null) ? 0 : getResUserAnswer().hashCode());
        result = prime * result + ((getResRightAnswer() == null) ? 0 : getResRightAnswer().hashCode());
        result = prime * result + ((getResultTopic() == null) ? 0 : getResultTopic().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getResultState() == null) ? 0 : getResultState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", resultId=").append(resultId);
        sb.append(", resTopicInfo=").append(resTopicInfo);
        sb.append(", resTopicClassify=").append(resTopicClassify);
        sb.append(", resUserAnswer=").append(resUserAnswer);
        sb.append(", resRightAnswer=").append(resRightAnswer);
        sb.append(", resultTopic=").append(resultTopic);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", resultState=").append(resultState);
        sb.append("]");
        return sb.toString();
    }
}